<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div class="box" aaa="123" title="" name="" data-abc="lululu"></div>
    <script>
       let div = document.querySelector('.box');
        //let aaa =  div.getAttribute('aaa');
        // div.setAttribute('bbb','123');
        // console.log(aaa);

        // 获取data-自定义属性
        // 元素.dataset.属性名字
        // let str = div.dataset.abc;
        // console.log(str);

        // 设置自定义属性
        // div.dataset.fff = "jintianzhenkaixin";




    </script>
</body>
</html>